package com.tmall.qatest.domain;

import com.taobao.hsf.notify.client.message.Message;
import com.taobao.tc.domain.dataobject.OrderInfoTO;
import com.taobao.tc.message.convertor.OrderInfoMessageConverter;
import com.taobao.tc.message.msgtype.MsgType;

/**
 * Created with IntelliJ IDEA.
 * User: Shuffle
 * Date: 13-1-31
 * Time: 下午1:54
 * To change this template use File | Settings | File Templates.
 */
public class TradeWood implements Wood {
    private OrderInfoTO tradeOrder;
    private OrderInfoMessageConverter tradeOrderConverter;

    public void setTradeOrder(OrderInfoTO tradeOrder) {
        this.tradeOrder = tradeOrder;
    }

    public void setTradeOrderConverter(OrderInfoMessageConverter tradeOrderConverter) {
        this.tradeOrderConverter = tradeOrderConverter;
    }

    @Override
    public Message prepareWood() {
        return tradeOrderConverter.toMessage(tradeOrder);
    }

    @Override
    public String getWoodType() {
        return tradeOrderConverter.getMessageType();
    }
}
